/**
Company: Sarkar software technologys
WebSite: http://www.sarkar.cn
Author: yeganaaa
Date : 5/16/18
Time: 11:47 AM
 */

package Cn.Sarkar.IMS.Entities

import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.IMS.IIMSApplicationDomain
import Cn.Sarkar.Entities.IMS.IPriceItem
import Cn.Sarkar.Entities.IMS.IPriceTable
import Cn.Sarkar.Entities.IMS.IProduct
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.IMS.DataBaseDefinations.PriceItems

class PriceItem(DataContext: IDataContext) : IPriceItem, BaseEntity(DataContext, PriceItems) {
    var applicationDomainID by PriceItems.IMSApplicationDomainID
    override var applicationDomain: IIMSApplicationDomain by hasOne(PriceItems.IMSApplicationDomainID) { IMSApplicationDomain(it) }
    var priceTableID by PriceItems.PriceTableID
    override var priceTable: IPriceTable by hasOne(PriceItems.PriceTableID) { PriceTable(it) }
    var productID by PriceItems.ProductID
    override var product: IProduct by hasOne(PriceItems.ProductID) { Product(it) }
    override var price: Float by PriceItems.Price
}
